package com.norma.macaron.common.model.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.norma.macaron.common.model.enums.CommonCode;
import com.norma.macaron.common.model.enums.ResultCode;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author zhangchaofeng
 * @date 2020/6/4 0004
 * @description
 */
@Data
@NoArgsConstructor
public class ResponseT<T> extends BaseResponse implements Serializable {

    private static final long serialVersionUID = 6229013132822979012L;

    //@JsonInclude(JsonInclude.Include.NON_NULL)
    private T data;

    public ResponseT(ResultCode resultCode) {
        super(resultCode);
    }

    public ResponseT(ResultCode resultCode, T data) {
        super(resultCode);
        this.data = data;
    }

    public ResponseT(Integer code, String message, T data) {
        super(code, message);
        this.data = data;
    }

    public ResponseT(T data){
        super(CommonCode.SUCCESS);
        this.data = data;
    }

}
